package com.dong.ioc.annotation;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.annotation.Order;

import javax.annotation.Priority;

/**
 * description
 *
 * @author Administrator 2021/08/31 14:45
 */
@Configuration
public class MyConfiguration {

    @Bean
    @Primary
    public Account account1(){
        return new Account(1);
    }

    @Bean(name = {"main"})
    public Account account2(){
        return new Account(2);
    }

    @Bean
    @Order(10)
    public Account account3(){
        return new Account(3);
    }

    @Bean
    public Account account4(){
        return new Account(4);
    }

    @Bean
    public User user(){
        return new User();
    }

    @Bean
    public Company company(){
        return new Company();
    }
}
